<template>
  <div id="app">
    <!--可以把公共部分做成组件-->
    <HeaderTop v-show="$route.meta.showHeaderTop" />
    <HeaderSearch v-show="$route.meta.showHeaderSearch" />
  
      <router-view></router-view>
  
  </div>
</template>

<script>
import HeaderTop from "@/components/HeaderTop";
import HeaderSearch from "@/components/HeaderSearch";
export default {
  name: "app",
  //加载事件
  mounted(){
      let userInfo = JSON.parse(window.localStorage.getItem("userInfo"));
      if(userInfo){
        this.syncUserInfo(userInfo);
      }
    },
    //方法定义
    methods: {
     // ...mapActions(['syncUserInfo']),
    },
    //组件定义
  components: {
    HeaderTop,
    HeaderSearch,
  },
};
</script>

<style>
#app{
  width: 100%;
  height: 100%;
  position: relative;
  list-style: none;
}
</style>
